<!DOCTYPE html>
<html>

<head>
    <!--<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/eruda"></script>

    <script>
        eruda.init();
    </script>-->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="Nolos五子棋" />
    <meta name="description" content="一个简易的在线五子棋软件。来看看你能不能打败它！" />
    <title>Nolos五子棋[大师模式]</title>
    <style>
        .help {
            background-color: #4caf50;
            border: 2px solid #4caf50;
            border-radius: 7px;
            color: white;
            padding: 5px 10px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
        }

        .help:hover {
            transition-duration: 500ms;
            background-color: #ffffff;
            color: #4caf50;
        }

        .help:active {
            transition-duration: 0ms;
            background-color: darkgreen;
            color: white;
        }

        .help:disabled {
            background-color: #4caf50;
            color: white;
            opacity: .6;
            cursor: not-allowed;
        }

        .help_used {
            background-color: #03c3d1;
            border: 2px solid #03c3d1;
            border-radius: 7px;
            color: white;
            padding: 5px 10px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
        }

        .help_used:active {
            transition-duration: 0ms;
            background-color: #0081cc;
            color: white;
        }

        .help_used:hover {
            transition-duration: 500ms;
            background-color: #ffffff;
            color: #03c3d1;
        }

        .help_used:disabled {
            background-color: #03c3d1;
            color: white;
            opacity: .6;
            cursor: not-allowed;
        }
    </style>
    <script>
        var black = 2;
        var white = 1;
        var empty = 0;
        var human = white;
        var nolos = black;
        const INFINITY = 999999, threshold = 19000, preRecord = [
            [[7, 7], [8, 8], [6, 8], [8, 6], [6, 9], [7, 6], [8, 9], [6, 6], [9, 6], [7, 9], [6, 10], [6, 11], [5, 10], [4, 10], [7, 10], [7, 8], [8, 11], [5, 8], [8, 10], [9, 10], [8, 12], [8, 13], [9, 12], [10, 13], [6, 12], [7, 12], [7, 11]], [[7, 7], [6, 8], [8, 8], [6, 6], [8, 9], [7, 6], [6, 9], [8, 6], [5, 6], [7, 9], [8, 10], [8, 11], [9, 10], [10, 10], [7, 10], [7, 8], [6, 11], [9, 8], [6, 10], [5, 10], [6, 12], [6, 13], [5, 12], [4, 13], [8, 12], [7, 12], [7, 11]], [[7, 7], [8, 6], [6, 6], [8, 8], [6, 5], [7, 8], [8, 5], [6, 8], [9, 8], [7, 5], [6, 4], [6, 3], [5, 4], [4, 4], [7, 4], [7, 6], [8, 3], [5, 6], [8, 4], [9, 4], [8, 2], [8, 1], [9, 2], [10, 1], [6, 2], [7, 2], [7, 3]], [[7, 7], [6, 6], [8, 6], [6, 8], [8, 5], [7, 8], [6, 5], [8, 8], [5, 8], [7, 5], [8, 4], [8, 3], [9, 4], [10, 4], [7, 4], [7, 6], [6, 3], [9, 6], [6, 4], [5, 4], [6, 2], [6, 1], [5, 2], [4, 1], [8, 2], [7, 2], [7, 3]], [[7, 7], [8, 8], [8, 6], [6, 8], [9, 6], [6, 7], [9, 8], [6, 6], [6, 9], [9, 7], [10, 6], [11, 6], [10, 5], [10, 4], [10, 7], [8, 7], [11, 8], [8, 5], [10, 8], [10, 9], [12, 8], [13, 8], [12, 9], [13, 10], [12, 6], [12, 7], [11, 7]], [[7, 7], [6, 8], [6, 6], [8, 8], [5, 6], [8, 7], [5, 8], [8, 6], [8, 9], [5, 7], [4, 6], [3, 6], [4, 5], [4, 4], [4, 7], [6, 7], [3, 8], [6, 5], [4, 8], [4, 9], [2, 8], [1, 8], [2, 9], [1, 10], [2, 6], [2, 7], [3, 7]], [[7, 7], [8, 6], [8, 8], [6, 6], [9, 8], [6, 7], [9, 6], [6, 8], [6, 5], [9, 7], [10, 8], [11, 8], [10, 9], [10, 10], [10, 7], [8, 7], [11, 6], [8, 9], [10, 6], [10, 5], [12, 6], [13, 6], [12, 5], [13, 4], [12, 8], [12, 7], [11, 7]], [[7, 7], [6, 6], [6, 8], [8, 6], [5, 8], [8, 7], [5, 6], [8, 8], [8, 5], [5, 7], [4, 8], [3, 8], [4, 9], [4, 10], [4, 7], [6, 7], [3, 6], [6, 9], [4, 6], [4, 5], [2, 6], [1, 6], [2, 5], [1, 4], [2, 8], [2, 7], [3, 7]],
            [[7, 7], [7, 6], [8, 6], [9, 5], [6, 8], [8, 7], [6, 7], [6, 5], [9, 8], [7, 5], [5, 5], [10, 5], [8, 5], [5, 4], [4, 3], [7, 8], [9, 6], [6, 6], [5, 9], [4, 10], [5, 7], [4, 6], [4, 7], [3, 7], [5, 6], [5, 8], [9, 9], [9, 7], [10, 7], [11, 8], [8, 9], [7, 10], [8, 10], [7, 9], [7, 11], [10, 8], [8, 12], [8, 11]], [[7, 7], [7, 6], [6, 6], [5, 5], [8, 8], [6, 7], [8, 7], [8, 5], [5, 8], [7, 5], [9, 5], [4, 5], [6, 5], [9, 4], [10, 3], [7, 8], [5, 6], [8, 6], [9, 9], [10, 10], [9, 7], [10, 6], [10, 7], [11, 7], [9, 6], [9, 8], [5, 9], [5, 7], [4, 7], [3, 8], [6, 9], [7, 10], [6, 10], [7, 9], [7, 11], [4, 8], [6, 12], [6, 11]], [[7, 7], [7, 8], [8, 8], [9, 9], [6, 6], [8, 7], [6, 7], [6, 9], [9, 6], [7, 9], [5, 9], [10, 9], [8, 9], [5, 10], [4, 11], [7, 6], [9, 8], [6, 8], [5, 5], [4, 4], [5, 7], [4, 8], [4, 7], [3, 7], [5, 8], [5, 6], [9, 5], [9, 7], [10, 7], [11, 6], [8, 5], [7, 4], [8, 4], [7, 5], [7, 3], [10, 6], [8, 2], [8, 3]], [[7, 7], [7, 8], [6, 8], [5, 9], [8, 6], [6, 7], [8, 7], [8, 9], [5, 6], [7, 9], [9, 9], [4, 9], [6, 9], [9, 10], [10, 11], [7, 6], [5, 8], [8, 8], [9, 5], [10, 4], [9, 7], [10, 8], [10, 7], [11, 7], [9, 8], [9, 6], [5, 5], [5, 7], [4, 7], [3, 6], [6, 5], [7, 4], [6, 4], [7, 5], [7, 3], [4, 6], [6, 2], [6, 3]], [[7, 7], [6, 7], [6, 8], [5, 9], [8, 6], [7, 8], [7, 6], [5, 6], [8, 9], [5, 7], [5, 5], [5, 10], [5, 8], [4, 5], [3, 4], [8, 7], [6, 9], [6, 6], [9, 5], [10, 4], [7, 5], [6, 4], [7, 4], [7, 3], [6, 5], [8, 5], [9, 9], [7, 9], [7, 10], [8, 11], [9, 8], [10, 7], [10, 8], [9, 7], [11, 7], [8, 10], [12, 8], [11, 8]], [[7, 7], [8, 7], [8, 8], [9, 9], [6, 6], [7, 8], [7, 6], [9, 6], [6, 9], [9, 7], [9, 5], [9, 10], [9, 8], [10, 5], [11, 4], [6, 7], [8, 9], [8, 6], [5, 5], [4, 4], [7, 5], [8, 4], [7, 4], [7, 3], [8, 5], [6, 5], [5, 9], [7, 9], [7, 10], [6, 11], [5, 8], [4, 7], [4, 8], [5, 7], [3, 7], [6, 10], [2, 8], [3, 8]], [[7, 7], [6, 7], [6, 6], [5, 5], [8, 8], [7, 6], [7, 8], [5, 8], [8, 5], [5, 7], [5, 9], [5, 4], [5, 6], [4, 9], [3, 10], [8, 7], [6, 5], [6, 8], [9, 9], [10, 10], [7, 9], [6, 10], [7, 10], [7, 11], [6, 9], [8, 9], [9, 5], [7, 5], [7, 4], [8, 3], [9, 6], [10, 7], [10, 6], [9, 7], [11, 7], [8, 4], [12, 6], [11, 6]], [[7, 7], [8, 7], [8, 6], [9, 5], [6, 8], [7, 6], [7, 8], [9, 8], [6, 5], [9, 7], [9, 9], [9, 4], [9, 6], [10, 9], [11, 10], [6, 7], [8, 5], [8, 8], [5, 9], [4, 10], [7, 9], [8, 10], [7, 10], [7, 11], [8, 9], [6, 9], [5, 5], [7, 5], [7, 4], [6, 3], [5, 6], [4, 7], [4, 6], [5, 7], [3, 7], [6, 4], [2, 6], [3, 6]],
            [[7, 7], [7, 6], [8, 6], [6, 8], [9, 5], [8, 7], [8, 5], [6, 5], [9, 8], [6, 6], [6, 4], [6, 9], [6, 7], [5, 4], [4, 3], [9, 6], [10, 5], [11, 5], [10, 4], [11, 3], [7, 5], [5, 3], [10, 6]], [[7, 7], [7, 6], [6, 6], [8, 8], [5, 5], [6, 7], [6, 5], [8, 5], [5, 8], [8, 6], [8, 4], [8, 9], [8, 7], [9, 4], [10, 3], [5, 6], [4, 5], [3, 5], [4, 4], [3, 3], [7, 5], [9, 3], [4, 6]], [[7, 7], [7, 8], [8, 8], [6, 6], [9, 9], [8, 7], [8, 9], [6, 9], [9, 6], [6, 8], [6, 10], [6, 5], [6, 7], [5, 10], [4, 11], [9, 8], [10, 9], [11, 9], [10, 10], [11, 11], [7, 9], [5, 11], [10, 8]], [[7, 7], [7, 8], [6, 8], [8, 6], [5, 9], [6, 7], [6, 9], [8, 9], [5, 6], [8, 8], [8, 10], [8, 5], [8, 7], [9, 10], [10, 11], [5, 8], [4, 9], [3, 9], [4, 10], [3, 11], [7, 9], [9, 11], [4, 8]], [[7, 7], [6, 7], [6, 8], [8, 6], [5, 9], [7, 8], [5, 8], [5, 6], [8, 9], [6, 6], [4, 6], [9, 6], [7, 6], [4, 5], [3, 4], [6, 9], [5, 10], [5, 11], [4, 10], [3, 11], [5, 7], [3, 5], [6, 10]], [[7, 7], [8, 7], [8, 8], [6, 6], [9, 9], [7, 8], [9, 8], [9, 6], [6, 9], [8, 6], [10, 6], [5, 6], [7, 6], [10, 5], [11, 4], [8, 9], [9, 10], [9, 11], [10, 10], [11, 11], [9, 7], [11, 5], [8, 10]], [[7, 7], [6, 7], [6, 6], [8, 8], [5, 5], [7, 6], [5, 6], [5, 8], [8, 5], [6, 8], [4, 8], [9, 8], [7, 8], [4, 9], [3, 10], [6, 5], [5, 4], [5, 3], [4, 4], [3, 3], [5, 7], [3, 9], [6, 4]], [[7, 7], [8, 7], [8, 6], [6, 8], [9, 5], [7, 6], [9, 6], [9, 8], [6, 5], [8, 8], [10, 8], [5, 8], [7, 8], [10, 9], [11, 10], [8, 5], [9, 4], [9, 3], [10, 4], [11, 3], [9, 7], [11, 9], [8, 4]],
            [[7, 7], [6, 6], [8, 6], [6, 8], [8, 5], [8, 7], [7, 5], [6, 9], [6, 5], [5, 5], [9, 5], [10, 5], [10, 4], [11, 3], [6, 4], [9, 7], [7, 4], [7, 8], [9, 6], [6, 10], [6, 7], [6, 11], [6, 12], [5, 10], [4, 11], [7, 6]], [[7, 7], [8, 6], [6, 6], [8, 8], [6, 5], [6, 7], [7, 5], [8, 9], [8, 5], [9, 5], [5, 5], [4, 5], [4, 4], [3, 3], [8, 4], [5, 7], [7, 4], [7, 8], [5, 6], [8, 10], [8, 7], [8, 11], [8, 12], [9, 10], [10, 11], [7, 6]], [[7, 7], [6, 8], [8, 8], [6, 6], [8, 9], [8, 7], [7, 9], [6, 5], [6, 9], [5, 9], [9, 9], [10, 9], [10, 10], [11, 11], [6, 10], [9, 7], [7, 10], [7, 6], [9, 8], [6, 4], [6, 7], [6, 3], [6, 2], [5, 4], [4, 3], [7, 8]], [[7, 7], [8, 8], [6, 8], [8, 6], [6, 9], [6, 7], [7, 9], [8, 5], [8, 9], [9, 9], [5, 9], [4, 9], [4, 10], [3, 11], [8, 10], [5, 7], [7, 10], [7, 6], [5, 8], [8, 4], [8, 7], [8, 3], [8, 2], [9, 4], [10, 3], [7, 8]], [[7, 7], [6, 6], [6, 8], [8, 6], [5, 8], [7, 8], [5, 7], [9, 6], [5, 6], [5, 5], [5, 9], [5, 10], [4, 10], [3, 11], [4, 6], [7, 9], [4, 7], [8, 7], [6, 9], [10, 6], [7, 6], [11, 6], [12, 6], [10, 5], [11, 4], [6, 7]], [[7, 7], [8, 6], [8, 8], [6, 6], [9, 8], [7, 8], [9, 7], [5, 6], [9, 6], [9, 5], [9, 9], [9, 10], [10, 10], [11, 11], [10, 6], [7, 9], [10, 7], [6, 7], [8, 9], [4, 6], [7, 6], [3, 6], [2, 6], [4, 5], [3, 4], [8, 7]], [[7, 7], [6, 8], [6, 6], [8, 8], [5, 6], [7, 6], [5, 7], [9, 8], [5, 8], [5, 9], [5, 5], [5, 4], [4, 4], [3, 3], [4, 8], [7, 5], [4, 7], [8, 7], [6, 5], [10, 8], [7, 8], [11, 8], [12, 8], [10, 9], [11, 10], [6, 7]], [[7, 7], [8, 8], [8, 6], [6, 8], [9, 6], [7, 6], [9, 7], [5, 8], [9, 8], [9, 9], [9, 5], [9, 4], [10, 4], [11, 3], [10, 8], [7, 5], [10, 7], [6, 7], [8, 5], [4, 8], [7, 8], [3, 8], [2, 8], [4, 9], [3, 10], [8, 7]],
            [[7, 7], [7, 8], [6, 8], [6, 7], [5, 6], [5, 7], [8, 6], [9, 5], [4, 6], [7, 6], [2, 6], [3, 6], [3, 7], [5, 9], [5, 5], [6, 4], [2, 8], [1, 9], [2, 9], [2, 7], [4, 7], [3, 8], [4, 4]], [[7, 7], [7, 8], [8, 8], [8, 7], [9, 6], [9, 7], [6, 6], [5, 5], [10, 6], [7, 6], [12, 6], [11, 6], [11, 7], [9, 9], [9, 5], [8, 4], [12, 8], [13, 9], [12, 9], [12, 7], [10, 7], [11, 8], [10, 4]], [[7, 7], [7, 6], [6, 6], [6, 7], [5, 8], [5, 7], [8, 8], [9, 9], [4, 8], [7, 8], [2, 8], [3, 8], [3, 7], [5, 5], [5, 9], [6, 10], [2, 6], [1, 5], [2, 5], [2, 7], [4, 7], [3, 6], [4, 10]], [[7, 7], [7, 6], [8, 6], [8, 7], [9, 8], [9, 7], [6, 8], [5, 9], [10, 8], [7, 8], [12, 8], [11, 8], [11, 7], [9, 5], [9, 9], [8, 10], [12, 6], [13, 5], [12, 5], [12, 7], [10, 7], [11, 6], [10, 10]], [[7, 7], [8, 7], [8, 6], [7, 6], [6, 5], [7, 5], [6, 8], [5, 9], [6, 4], [6, 7], [6, 2], [6, 3], [7, 3], [9, 5], [5, 5], [4, 6], [8, 2], [9, 1], [9, 2], [7, 2], [7, 4], [8, 3], [4, 4]], [[7, 7], [6, 7], [6, 6], [7, 6], [8, 5], [7, 5], [8, 8], [9, 9], [8, 4], [8, 7], [8, 2], [8, 3], [7, 3], [5, 5], [9, 5], [10, 6], [6, 2], [5, 1], [5, 2], [7, 2], [7, 4], [6, 3], [10, 4]], [[7, 7], [8, 7], [8, 8], [7, 8], [6, 9], [7, 9], [6, 6], [5, 5], [6, 10], [6, 7], [6, 12], [6, 11], [7, 11], [9, 9], [5, 9], [4, 8], [8, 12], [9, 13], [9, 12], [7, 12], [7, 10], [8, 11], [4, 10]], [[7, 7], [6, 7], [6, 8], [7, 8], [8, 9], [7, 9], [8, 6], [9, 5], [8, 10], [8, 7], [8, 12], [8, 11], [7, 11], [5, 9], [9, 9], [10, 8], [6, 12], [5, 13], [5, 12], [7, 12], [7, 10], [6, 11], [10, 10]],
            [[7, 7], [6, 7], [6, 8], [7, 8], [5, 6], [5, 7], [8, 6], [9, 5], [4, 6], [7, 6], [2, 6], [3, 6], [3, 7], [5, 9], [5, 5], [6, 4], [2, 8], [1, 9], [2, 9], [2, 7], [4, 7], [3, 8], [4, 4]], [[7, 7], [8, 7], [8, 8], [7, 8], [9, 6], [9, 7], [6, 6], [5, 5], [10, 6], [7, 6], [12, 6], [11, 6], [11, 7], [9, 9], [9, 5], [8, 4], [12, 8], [13, 9], [12, 9], [12, 7], [10, 7], [11, 8], [10, 4]], [[7, 7], [6, 7], [6, 6], [7, 6], [5, 8], [5, 7], [8, 8], [9, 9], [4, 8], [7, 8], [2, 8], [3, 8], [3, 7], [5, 5], [5, 9], [6, 10], [2, 6], [1, 5], [2, 5], [2, 7], [4, 7], [3, 6], [4, 10]], [[7, 7], [8, 7], [8, 6], [7, 6], [9, 8], [9, 7], [6, 8], [5, 9], [10, 8], [7, 8], [12, 8], [11, 8], [11, 7], [9, 5], [9, 9], [8, 10], [12, 6], [13, 5], [12, 5], [12, 7], [10, 7], [11, 6], [10, 10]], [[7, 7], [7, 6], [8, 6], [8, 7], [6, 5], [7, 5], [6, 8], [5, 9], [6, 4], [6, 7], [6, 2], [6, 3], [7, 3], [9, 5], [5, 5], [4, 6], [8, 2], [9, 1], [9, 2], [7, 2], [7, 4], [8, 3], [4, 4]], [[7, 7], [7, 6], [6, 6], [6, 7], [8, 5], [7, 5], [8, 8], [9, 9], [8, 4], [8, 7], [8, 2], [8, 3], [7, 3], [5, 5], [9, 5], [10, 6], [6, 2], [5, 1], [5, 2], [7, 2], [7, 4], [6, 3], [10, 4]], [[7, 7], [7, 8], [8, 8], [8, 7], [6, 9], [7, 9], [6, 6], [5, 5], [6, 10], [6, 7], [6, 12], [6, 11], [7, 11], [9, 9], [5, 9], [4, 8], [8, 12], [9, 13], [9, 12], [7, 12], [7, 10], [8, 11], [4, 10]], [[7, 7], [7, 8], [6, 8], [6, 7], [8, 9], [7, 9], [8, 6], [9, 5], [8, 10], [8, 7], [8, 12], [8, 11], [7, 11], [5, 9], [9, 9], [10, 8], [6, 12], [5, 13], [5, 12], [7, 12], [7, 10], [6, 11], [10, 10]],
            [[7, 7], [8, 6], [8, 8], [9, 9], [6, 6], [6, 7], [5, 5], [4, 4], [5, 7], [6, 4], [7, 9], [5, 4], [7, 4], [3, 4], [2, 4], [7, 5], [9, 7], [10, 6], [7, 8]], [[7, 7], [6, 6], [6, 8], [5, 9], [8, 6], [8, 7], [9, 5], [10, 4], [9, 7], [8, 4], [7, 9], [9, 4], [7, 4], [11, 4], [12, 4], [7, 5], [5, 7], [4, 6], [7, 8]], [[7, 7], [8, 8], [8, 6], [9, 5], [6, 8], [6, 7], [5, 9], [4, 10], [5, 7], [6, 10], [7, 5], [5, 10], [7, 10], [3, 10], [2, 10], [7, 9], [9, 7], [10, 8], [7, 6]], [[7, 7], [6, 8], [6, 6], [5, 5], [8, 8], [8, 7], [9, 9], [10, 10], [9, 7], [8, 10], [7, 5], [9, 10], [7, 10], [11, 10], [12, 10], [7, 9], [5, 7], [4, 8], [7, 6]], [[7, 7], [6, 8], [8, 8], [9, 9], [6, 6], [7, 6], [5, 5], [4, 4], [7, 5], [4, 6], [9, 7], [4, 5], [4, 7], [4, 3], [4, 2], [5, 7], [7, 9], [6, 10], [8, 7]], [[7, 7], [8, 8], [6, 8], [5, 9], [8, 6], [7, 6], [9, 5], [10, 4], [7, 5], [10, 6], [5, 7], [10, 5], [10, 7], [10, 3], [10, 2], [9, 7], [7, 9], [8, 10], [6, 7]], [[7, 7], [6, 6], [8, 6], [9, 5], [6, 8], [7, 8], [5, 9], [4, 10], [7, 9], [4, 8], [9, 7], [4, 9], [4, 7], [4, 11], [4, 12], [5, 7], [7, 5], [6, 4], [8, 7]], [[7, 7], [8, 6], [6, 6], [5, 5], [8, 8], [7, 8], [9, 9], [10, 10], [7, 9], [10, 8], [5, 7], [10, 9], [10, 7], [10, 11], [10, 12], [9, 7], [7, 5], [8, 4], [6, 7]],
            [[7, 7], [6, 6], [8, 6], [8, 7], [6, 8], [5, 9], [9, 5], [10, 4], [9, 7], [8, 4], [7, 9], [9, 4], [7, 4], [7, 5], [5, 7], [4, 6], [7, 8], [9, 3], [10, 2], [12, 4], [11, 4]], [[7, 7], [8, 6], [6, 6], [6, 7], [8, 8], [9, 9], [5, 5], [4, 4], [5, 7], [6, 4], [7, 9], [5, 4], [7, 4], [7, 5], [9, 7], [10, 6], [7, 8], [5, 3], [4, 2], [2, 4], [3, 4]], [[7, 7], [6, 8], [8, 8], [8, 7], [6, 6], [5, 5], [9, 9], [10, 10], [9, 7], [8, 10], [7, 5], [9, 10], [7, 10], [7, 9], [5, 7], [4, 8], [7, 6], [9, 11], [10, 12], [12, 10], [11, 10]], [[7, 7], [8, 8], [6, 8], [6, 7], [8, 6], [9, 5], [5, 9], [4, 10], [5, 7], [6, 10], [7, 5], [5, 10], [7, 10], [7, 9], [9, 7], [10, 8], [7, 6], [5, 11], [4, 12], [2, 10], [3, 10]], [[7, 7], [6, 6], [6, 8], [7, 8], [8, 6], [9, 5], [5, 9], [4, 10], [7, 9], [4, 8], [9, 7], [4, 9], [4, 7], [5, 7], [7, 5], [6, 4], [8, 7], [3, 9], [2, 10], [4, 12], [4, 11]], [[7, 7], [8, 6], [8, 8], [7, 8], [6, 6], [5, 5], [9, 9], [10, 10], [7, 9], [10, 8], [5, 7], [10, 9], [10, 7], [9, 7], [7, 5], [8, 4], [6, 7], [11, 9], [12, 10], [10, 12], [10, 11]], [[7, 7], [6, 8], [6, 6], [7, 6], [8, 8], [9, 9], [5, 5], [4, 4], [7, 5], [4, 6], [9, 7], [4, 5], [4, 7], [5, 7], [7, 9], [6, 10], [8, 7], [3, 5], [2, 4], [4, 2], [4, 3]], [[7, 7], [8, 8], [8, 6], [7, 6], [6, 8], [5, 9], [9, 5], [10, 4], [7, 5], [10, 6], [5, 7], [10, 5], [10, 7], [9, 7], [7, 9], [8, 10], [6, 7], [11, 5], [12, 4], [10, 2], [10, 3]],
            [[7, 7], [7, 6], [8, 6], [8, 7], [9, 8], [9, 5], [9, 9], [8, 8], [9, 10], [9, 7], [7, 9], [7, 8], [8, 10], [9, 11], [7, 10], [6, 10], [8, 9]], [[7, 7], [7, 6], [6, 6], [6, 7], [5, 8], [5, 5], [5, 9], [6, 8], [5, 10], [5, 7], [7, 9], [7, 8], [6, 10], [5, 11], [7, 10], [8, 10], [6, 9]], [[7, 7], [7, 8], [8, 8], [8, 7], [9, 6], [9, 9], [9, 5], [8, 6], [9, 4], [9, 7], [7, 5], [7, 6], [8, 4], [9, 3], [7, 4], [6, 4], [8, 5]], [[7, 7], [7, 8], [6, 8], [6, 7], [5, 6], [5, 9], [5, 5], [6, 6], [5, 4], [5, 7], [7, 5], [7, 6], [6, 4], [5, 3], [7, 4], [8, 4], [6, 5]], [[7, 7], [6, 7], [6, 8], [7, 8], [8, 9], [5, 9], [9, 9], [8, 8], [10, 9], [7, 9], [9, 7], [8, 7], [10, 8], [11, 9], [10, 7], [10, 6], [9, 8]], [[7, 7], [8, 7], [8, 8], [7, 8], [6, 9], [9, 9], [5, 9], [6, 8], [4, 9], [7, 9], [5, 7], [6, 7], [4, 8], [3, 9], [4, 7], [4, 6], [5, 8]], [[7, 7], [6, 7], [6, 6], [7, 6], [8, 5], [5, 5], [9, 5], [8, 6], [10, 5], [7, 5], [9, 7], [8, 7], [10, 6], [11, 5], [10, 7], [10, 8], [9, 6]], [[7, 7], [8, 7], [8, 6], [7, 6], [6, 5], [9, 5], [5, 5], [6, 6], [4, 5], [7, 5], [5, 7], [6, 7], [4, 6], [3, 5], [4, 7], [4, 8], [5, 6]],
[[7,7],[6,6],[8,6],[6,8],[8,5],[8,7],[7,5],[6,5],[6,4],[5,3],[7,6],[7,4],[10,6],[7,8],[10,8],[9,7],[9,6],[11,6],[10,5],[6,7],[6,9],[10,7],[9,5],[11,5],[11,7],[8,4],[12,8],[13,9],[12,6],[13,5],[10,3],[10,4],[12,5],[11,4],[9,4],[11,2],[11,3],[12,7],[9,3],[9,2]],[[7,7],[8,6],[6,6],[8,8],[6,5],[6,7],[7,5],[8,5],[8,4],[9,3],[7,6],[7,4],[4,6],[7,8],[4,8],[5,7],[5,6],[3,6],[4,5],[8,7],[8,9],[4,7],[5,5],[3,5],[3,7],[6,4],[2,8],[1,9],[2,6],[1,5],[4,3],[4,4],[2,5],[3,4],[5,4],[3,2],[3,3],[2,7],[5,3],[5,2]],[[7,7],[6,8],[8,8],[6,6],[8,9],[8,7],[7,9],[6,9],[6,10],[5,11],[7,8],[7,10],[10,8],[7,6],[10,6],[9,7],[9,8],[11,8],[10,9],[6,7],[6,5],[10,7],[9,9],[11,9],[11,7],[8,10],[12,6],[13,5],[12,8],[13,9],[10,11],[10,10],[12,9],[11,10],[9,10],[11,12],[11,11],[12,7],[9,11],[9,12]],[[7,7],[8,8],[6,8],[8,6],[6,9],[6,7],[7,9],[8,9],[8,10],[9,11],[7,8],[7,10],[4,8],[7,6],[4,6],[5,7],[5,8],[3,8],[4,9],[8,7],[8,5],[4,7],[5,9],[3,9],[3,7],[6,10],[2,6],[1,5],[2,8],[1,9],[4,11],[4,10],[2,9],[3,10],[5,10],[3,12],[3,11],[2,7],[5,11],[5,12]],[[7,7],[6,6],[6,8],[8,6],[5,8],[7,8],[5,7],[5,6],[4,6],[3,5],[6,7],[4,7],[6,10],[8,7],[8,10],[7,9],[6,9],[6,11],[5,10],[7,6],[9,6],[7,10],[5,9],[5,11],[7,11],[4,8],[8,12],[9,13],[6,12],[5,13],[3,10],[4,10],[5,12],[4,11],[4,9],[2,11],[3,11],[7,12],[3,9],[2,9]],[[7,7],[8,6],[8,8],[6,6],[9,8],[7,8],[9,7],[9,6],[10,6],[11,5],[8,7],[10,7],[8,10],[6,7],[6,10],[7,9],[8,9],[8,11],[9,10],[7,6],[5,6],[7,10],[9,9],[9,11],[7,11],[10,8],[6,12],[5,13],[8,12],[9,13],[11,10],[10,10],[9,12],[10,11],[10,9],[12,11],[11,11],[7,12],[11,9],[12,9]],[[7,7],[6,8],[6,6],[8,8],[5,6],[7,6],[5,7],[5,8],[4,8],[3,9],[6,7],[4,7],[6,4],[8,7],[8,4],[7,5],[6,5],[6,3],[5,4],[7,8],[9,8],[7,4],[5,5],[5,3],[7,3],[4,6],[8,2],[9,1],[6,2],[5,1],[3,4],[4,4],[5,2],[4,3],[4,5],[2,3],[3,3],[7,2],[3,5],[2,5]],[[7,7],[8,8],[8,6],[6,8],[9,6],[7,6],[9,7],[9,8],[10,8],[11,9],[8,7],[10,7],[8,4],[6,7],[6,4],[7,5],[8,5],[8,3],[9,4],[7,8],[5,8],[7,4],[9,5],[9,3],[7,3],[10,6],[6,2],[5,1],[8,2],[9,1],[11,4],[10,4],[9,2],[10,3],[10,5],[12,3],[11,3],[7,2],[11,5],[12,5]],
[[7,7],[8,6],[8,8],[6,6],[9,8],[10,8],[7,6],[7,8],[8,7],[6,5],[9,7],[6,7],[6,8],[6,4],[6,3],[8,9],[11,7],[10,7],[10,9],[11,10],[9,10],[5,6],[4,5],[9,9],[11,8],[12,7],[11,5]],[[7,7],[6,6],[6,8],[8,6],[5,8],[4,8],[7,6],[7,8],[6,7],[8,5],[5,7],[8,7],[8,8],[8,4],[8,3],[6,9],[3,7],[4,7],[4,9],[3,10],[5,10],[9,6],[10,5],[5,9],[3,8],[2,7],[3,5]],[[7,7],[8,8],[8,6],[6,8],[9,6],[10,6],[7,8],[7,6],[8,7],[6,9],[9,7],[6,7],[6,6],[6,10],[6,11],[8,5],[11,7],[10,7],[10,5],[11,4],[9,4],[5,8],[4,9],[9,5],[11,6],[12,7],[11,9]],[[7,7],[6,8],[6,6],[8,8],[5,6],[4,6],[7,8],[7,6],[6,7],[8,9],[5,7],[8,7],[8,6],[8,10],[8,11],[6,5],[3,7],[4,7],[4,5],[3,4],[5,4],[9,8],[10,9],[5,5],[3,6],[2,7],[3,9]],[[7,7],[6,8],[8,8],[6,6],[8,9],[8,10],[6,7],[8,7],[7,8],[5,6],[7,9],[7,6],[8,6],[4,6],[3,6],[9,8],[7,11],[7,10],[9,10],[10,11],[10,9],[6,5],[5,4],[9,9],[8,11],[7,12],[5,11]],[[7,7],[8,8],[6,8],[8,6],[6,9],[6,10],[8,7],[6,7],[7,8],[9,6],[7,9],[7,6],[6,6],[10,6],[11,6],[5,8],[7,11],[7,10],[5,10],[4,11],[4,9],[8,5],[9,4],[5,9],[6,11],[7,12],[9,11]],[[7,7],[6,6],[8,6],[6,8],[8,5],[8,4],[6,7],[8,7],[7,6],[5,8],[7,5],[7,8],[8,8],[4,8],[3,8],[9,6],[7,3],[7,4],[9,4],[10,3],[10,5],[6,9],[5,10],[9,5],[8,3],[7,2],[5,3]],[[7,7],[8,6],[6,6],[8,8],[6,5],[6,4],[8,7],[6,7],[7,6],[9,8],[7,5],[7,8],[6,8],[10,8],[11,8],[5,6],[7,3],[7,4],[5,4],[4,3],[4,5],[8,9],[9,10],[5,5],[6,3],[7,2],[9,3]],
[[7,7],[5,5],[6,8],[4,6],[7,8],[3,7],[6,4],[7,6],[8,8],[5,8],[8,6],[5,9],[5,7],[6,7],[8,5],[4,9],[3,10],[1,9],[2,8],[3,9],[2,9],[7,9],[6,9],[8,7],[10,8],[9,8],[7,5],[9,7],[9,5],[10,4],[10,5]],[[7,7],[9,5],[8,8],[10,6],[7,8],[11,7],[8,4],[7,6],[6,8],[9,8],[6,6],[9,9],[9,7],[8,7],[6,5],[10,9],[11,10],[13,9],[12,8],[11,9],[12,9],[7,9],[8,9],[6,7],[4,8],[5,8],[7,5],[5,7],[5,5],[4,4],[4,5]],[[7,7],[5,9],[6,6],[4,8],[7,6],[3,7],[6,10],[7,8],[8,6],[5,6],[8,8],[5,5],[5,7],[6,7],[8,9],[4,5],[3,4],[1,5],[2,6],[3,5],[2,5],[7,5],[6,5],[8,7],[10,6],[9,6],[7,9],[9,7],[9,9],[10,10],[10,9]],[[7,7],[9,9],[8,6],[10,8],[7,6],[11,7],[8,10],[7,8],[6,6],[9,6],[6,8],[9,5],[9,7],[8,7],[6,9],[10,5],[11,4],[13,5],[12,6],[11,5],[12,5],[7,5],[8,5],[6,7],[4,6],[5,6],[7,9],[5,7],[5,9],[4,10],[4,9]],[[7,7],[5,5],[8,6],[6,4],[8,7],[7,3],[4,6],[6,7],[8,8],[8,5],[6,8],[9,5],[7,5],[7,6],[5,8],[9,4],[10,3],[9,1],[8,2],[9,3],[9,2],[9,7],[9,6],[7,8],[8,10],[8,9],[5,7],[7,9],[5,9],[4,10],[5,10]],[[7,7],[9,5],[6,6],[8,4],[6,7],[7,3],[10,6],[8,7],[6,8],[6,5],[8,8],[5,5],[7,5],[7,6],[9,8],[5,4],[4,3],[5,1],[6,2],[5,3],[5,2],[5,7],[5,6],[7,8],[6,10],[6,9],[9,7],[7,9],[9,9],[10,10],[9,10]],[[7,7],[5,9],[8,8],[6,10],[8,7],[7,11],[4,8],[6,7],[8,6],[8,9],[6,6],[9,9],[7,9],[7,8],[5,6],[9,10],[10,11],[9,13],[8,12],[9,11],[9,12],[9,7],[9,8],[7,6],[8,4],[8,5],[5,7],[7,5],[5,5],[4,4],[5,4]],[[7,7],[9,9],[6,8],[8,10],[6,7],[7,11],[10,8],[8,7],[6,6],[6,9],[8,6],[5,9],[7,9],[7,8],[9,6],[5,10],[4,11],[5,13],[6,12],[5,11],[5,12],[5,7],[5,8],[7,6],[6,4],[6,5],[9,7],[7,5],[9,5],[10,4],[9,4]],
[[7,7],[4,4],[8,6]],[[7,7],[10,4],[6,6]],[[7,7],[4,10],[8,8]],[[7,7],[10,10],[6,8]],[[7,7],[4,4],[6,8]],[[7,7],[10,4],[8,8]],[[7,7],[4,10],[6,6]],[[7,7],[10,10],[8,6]],
[[7,7],[5,4],[8,6]],[[7,7],[9,4],[6,6]],[[7,7],[5,10],[8,8]],[[7,7],[9,10],[6,8]],[[7,7],[4,5],[6,8]],[[7,7],[10,5],[8,8]],[[7,7],[4,9],[6,6]],[[7,7],[10,9],[8,6]],
[[7,7],[6,4],[8,6]],[[7,7],[8,4],[6,6]],[[7,7],[6,10],[8,8]],[[7,7],[8,10],[6,8]],[[7,7],[4,6],[6,8]],[[7,7],[10,6],[8,8]],[[7,7],[4,8],[6,6]],[[7,7],[10,8],[8,6]],
[[7,7],[7,4],[7,9]],[[7,7],[7,4],[7,9]],[[7,7],[7,10],[7,5]],[[7,7],[7,10],[7,5]],[[7,7],[4,7],[9,7]],[[7,7],[10,7],[5,7]],[[7,7],[4,7],[9,7]],[[7,7],[10,7],[5,7]],
[[7,7],[7,5],[7,9],[6,8],[8,9],[6,9],[6,10],[7,10],[8,8],[9,7],[9,9],[10,10],[10,9],[11,9],[8,11],[8,12],[9,11],[10,8],[8,6],[8,10],[9,10],[12,10],[13,11],[8,7],[5,11],[4,12],[7,11],[6,11],[10,11],[11,11]],[[7,7],[7,5],[7,9],[8,8],[6,9],[8,9],[8,10],[7,10],[6,8],[5,7],[5,9],[4,10],[4,9],[3,9],[6,11],[6,12],[5,11],[4,8],[6,6],[6,10],[5,10],[2,10],[1,11],[6,7],[9,11],[10,12],[7,11],[8,11],[4,11],[3,11]],[[7,7],[7,9],[7,5],[6,6],[8,5],[6,5],[6,4],[7,4],[8,6],[9,7],[9,5],[10,4],[10,5],[11,5],[8,3],[8,2],[9,3],[10,6],[8,8],[8,4],[9,4],[12,4],[13,3],[8,7],[5,3],[4,2],[7,3],[6,3],[10,3],[11,3]],[[7,7],[7,9],[7,5],[8,6],[6,5],[8,5],[8,4],[7,4],[6,6],[5,7],[5,5],[4,4],[4,5],[3,5],[6,3],[6,2],[5,3],[4,6],[6,8],[6,4],[5,4],[2,4],[1,3],[6,7],[9,3],[10,2],[7,3],[8,3],[4,3],[3,3]],[[7,7],[5,7],[9,7],[8,6],[9,8],[9,6],[10,6],[10,7],[8,8],[7,9],[9,9],[10,10],[9,10],[9,11],[11,8],[12,8],[11,9],[8,10],[6,8],[10,8],[10,9],[10,12],[11,13],[7,8],[11,5],[12,4],[11,7],[11,6],[11,10],[11,11]],[[7,7],[9,7],[5,7],[6,6],[5,8],[5,6],[4,6],[4,7],[6,8],[7,9],[5,9],[4,10],[5,10],[5,11],[3,8],[2,8],[3,9],[6,10],[8,8],[4,8],[4,9],[4,12],[3,13],[7,8],[3,5],[2,4],[3,7],[3,6],[3,10],[3,11]],[[7,7],[5,7],[9,7],[8,8],[9,6],[9,8],[10,8],[10,7],[8,6],[7,5],[9,5],[10,4],[9,4],[9,3],[11,6],[12,6],[11,5],[8,4],[6,6],[10,6],[10,5],[10,2],[11,1],[7,6],[11,9],[12,10],[11,7],[11,8],[11,4],[11,3]],[[7,7],[9,7],[5,7],[6,8],[5,6],[5,8],[4,8],[4,7],[6,6],[7,5],[5,5],[4,4],[5,4],[5,3],[3,6],[2,6],[3,5],[6,4],[8,6],[4,6],[4,5],[4,2],[3,1],[7,6],[3,9],[2,10],[3,7],[3,8],[3,4],[3,3]],
[[7,7],[6,7],[6,6],[7,5],[8,8],[9,9],[6,8],[5,6],[7,9],[7,8],[8,9],[5,5],[8,5],[8,7],[5,9],[8,6],[6,10],[5,11],[6,9],[4,9],[4,10],[3,11],[8,10],[5,7],[7,10],[5,10],[8,11],[8,12]],[[7,7],[8,7],[8,6],[7,5],[6,8],[5,9],[8,8],[9,6],[7,9],[7,8],[6,9],[9,5],[6,5],[6,7],[9,9],[6,6],[8,10],[9,11],[8,9],[10,9],[10,10],[11,11],[6,10],[9,7],[7,10],[9,10],[6,11],[6,12]],[[7,7],[6,7],[6,8],[7,9],[8,6],[9,5],[6,6],[5,8],[7,5],[7,6],[8,5],[5,9],[8,9],[8,7],[5,5],[8,8],[6,4],[5,3],[6,5],[4,5],[4,4],[3,3],[8,4],[5,7],[7,4],[5,4],[8,3],[8,2]],[[7,7],[8,7],[8,8],[7,9],[6,6],[5,5],[8,6],[9,8],[7,5],[7,6],[6,5],[9,9],[6,9],[6,7],[9,5],[6,8],[8,4],[9,3],[8,5],[10,5],[10,4],[11,3],[6,4],[9,7],[7,4],[9,4],[6,3],[6,2]],[[7,7],[7,6],[6,6],[5,7],[8,8],[9,9],[8,6],[6,5],[9,7],[8,7],[9,8],[5,5],[5,8],[7,8],[9,5],[6,8],[10,6],[11,5],[9,6],[9,4],[10,4],[11,3],[10,8],[7,5],[10,7],[10,5],[11,8],[12,8]],[[7,7],[7,6],[8,6],[9,7],[6,8],[5,9],[6,6],[8,5],[5,7],[6,7],[5,8],[9,5],[9,8],[7,8],[5,5],[8,8],[4,6],[3,5],[5,6],[5,4],[4,4],[3,3],[4,8],[7,5],[4,7],[4,5],[3,8],[2,8]],[[7,7],[7,8],[6,8],[5,7],[8,6],[9,5],[8,8],[6,9],[9,7],[8,7],[9,6],[5,9],[5,6],[7,6],[9,9],[6,6],[10,8],[11,9],[9,8],[9,10],[10,10],[11,11],[10,6],[7,9],[10,7],[10,9],[11,6],[12,6]],[[7,7],[7,8],[8,8],[9,7],[6,6],[5,5],[6,8],[8,9],[5,7],[6,7],[5,6],[9,9],[9,6],[7,6],[5,9],[8,6],[4,8],[3,9],[5,8],[5,10],[4,10],[3,11],[4,6],[7,9],[4,7],[4,9],[3,6],[2,6]]
        ];
        var currentRecord = [];
        var step = 1, over = false, qp = [], wins = [], bwin = [], wwin = [], iswin = {}, wincount = 0, board, context, laststep, d1, d2;
        var canVCT = (value) => value >= 271;
        var match = (sonList, fatherList) => sonList.length < fatherList.length && sonList.every((item, index) => fatherList[index][0] == item[0] && fatherList[index][1] == item[1]);
        for (var i = 0; i < 15; i++) {
            qp[i] = [];
            wins[i] = [];
            for (var j = 0; j < 15; j++) {
                qp[i][j] = empty;
                wins[i][j] = [];
            }
        }
        for (var i = 0; i < 15; i++) {
            for (var j = 0; j < 11; j++) {
                for (var k = 0; k < 5; k++) {
                    wins[i][j + k][wincount] = true;
                }
                wincount++;
            }
        }
        for (var i = 0; i < 15; i++) {
            for (var j = 0; j < 11; j++) {
                for (var k = 0; k < 5; k++) {
                    wins[j + k][i][wincount] = true;
                }
                wincount++;
            }
        }
        for (var i = 0; i < 11; i++) {
            for (var j = 0; j < 11; j++) {
                for (var k = 0; k < 5; k++) {
                    wins[i + k][j + k][wincount] = true;
                }
                wincount++;
            }
        }
        for (var i = 0; i < 11; i++) {
            for (var j = 14; j > 3; j--) {
                for (var k = 0; k < 5; k++) {
                    wins[i + k][j - k][wincount] = true;
                }
                wincount++;
            }
        }
        for (var i = 0; i < wincount; i++) {
            bwin[i] = 0;
            wwin[i] = 0;
        }
        paintqp();

        var reverse = function (player) {
            return player == black ? white : black;
        }

        function paintqp() {
            document.write("<center><span id='timer'><font size=20>Nolos五子棋</font></span><br><canvas id=\"cboard\" width=540 height=540></canvas><br><button onclick='forward();' class=help id=help><font size=4>提示一步</font><br>（这会交换黑白双方！）</button></center>");
            board = document.getElementById("cboard");
            context = board.getContext("2d");
            var img = new Image();
            img.src = "./background.bmp";
            img.onload = () => {
                context.drawImage(img, 0, 0, 540, 540);
                context.fillStyle = "black";
                for (var i = 0; i < 15; i++) {
                    context.moveTo(18 + i * 36, 18);
                    context.lineTo(18 + i * 36, 522);
                    context.stroke();
                    context.moveTo(18, 18 + i * 36);
                    context.lineTo(522, 18 + i * 36);
                    context.stroke();
                }
                context.beginPath();
                context.arc(18 + 3 * 36, 18 + 3 * 36, 4, 0, 2 * Math.PI);
                context.fill();
                context.beginPath();
                context.arc(18 + 11 * 36, 18 + 11 * 36, 4, 0, 2 * Math.PI);
                context.fill();
                context.beginPath();
                context.arc(18 + 3 * 36, 18 + 11 * 36, 4, 0, 2 * Math.PI);
                context.fill();
                context.beginPath();
                context.arc(18 + 11 * 36, 18 + 3 * 36, 4, 0, 2 * Math.PI);
                context.fill();
                context.beginPath();
                context.arc(18 + 7 * 36, 18 + 7 * 36, 4, 0, 2 * Math.PI);
                context.fill();
                board.onclick = function (e) {
                    if (over) return;
                    var i = Math.floor(e.offsetX / 36);
                    var j = Math.floor(e.offsetY / 36);
                    act(i, j);
                };
                setv(7, 7, black);
            }
        }

        function getv(i, j) {
            return qp[i][j];
        }

        function setv(i, j, chess, notdraw) {
            qp[i][j] = chess;
            for (var k = 0; k < wincount; k++) {
                if (wins[i][j][k]) {
                    if (chess == black) {
                        bwin[k]++;
                        wwin[k] = 6;
                        iswin[black] = (bwin[k] == 5 | iswin[black]);
                    } else {
                        wwin[k]++;
                        bwin[k] = 6;
                        iswin[white] = (wwin[k] == 5 | iswin[white]);
                    }
                }
            }
            if (notdraw) return;
            currentRecord.push([i, j]);
            context.beginPath();
            context.arc(18 + i * 36, 18 + j * 36, 16, 0, 2 * Math.PI);
            context.fillStyle = chess == black ? "black" : "white";
            context.fill();
            context.beginPath();
            context.arc(18 + i * 36, 18 + j * 36, 7, 0, 2 * Math.PI);
            context.fillStyle = "red";
            context.fill();
            context.font = "16px bold calibri";
            context.textAlign = "center";
            context.textBaseline = "middle";
            if (laststep) {
                if (chess == black) {
                    context.beginPath();
                    context.arc(18 + laststep[0] * 36, 18 + laststep[1] * 36, 8, 0, 2 * Math.PI);
                    context.fillStyle = "white";
                    context.fill();
                    context.fillStyle = "black";
                    context.fillText(step, 18 + laststep[0] * 36, 18 + laststep[1] * 36);
                } else {
                    context.beginPath();
                    context.arc(18 + laststep[0] * 36, 18 + laststep[1] * 36, 8, 0, 2 * Math.PI);
                    context.fillStyle = "black";
                    context.fill();
                    context.fillStyle = "white";
                    context.fillText(step, 18 + laststep[0] * 36, 18 + laststep[1] * 36);
                }
            }
            laststep = [i, j];
        }

        function act(x, y) {
            if (getv(x, y) == empty) {
                d1 = (new Date()).getTime();
                setv(x, y, human);
                if (iswin[human] == true) {
                    document.getElementById("timer").innerHTML = human == white ? "白棋胜！请重新启动程序。" : "黑棋胜！请重新启动程序。";
                    over = true;
                    document.getElementById("help").disabled = over;
                    return;
                }
                step++;
                if (step >= 225) {
                    document.getElementById("timer").innerHTML = "平局！请重新启动程序。";
                    over = true;
                    document.getElementById("help").disabled = over;
                    return;
                }
                over = true;
                document.getElementById("help").disabled = over;
                document.getElementById("timer").innerHTML = "电脑正在思考……";
                setTimeout(function () {
                    ai();
                    step++;
                    if (iswin[nolos] == true) {
                        document.getElementById("timer").innerHTML = nolos == white ? "白棋胜！请重新启动程序。" : "黑棋胜！请重新启动程序。";
                        return;
                    }
                    if (step >= 225) {
                        document.getElementById("timer").innerHTML = "平局！请重新启动程序。";
                        return;
                    }
                    over = false;
                    document.getElementById("help").disabled = over;
                    d2 = (new Date()).getTime();
                    document.getElementById("timer").innerHTML = "本次电脑思考用时" + (d2 - d1 - 100).toString() + "毫秒。";
                }, 100);
            }
        }

        function forward() {
            if (step != 1) {
                alert("非开发人员只能在第一步使用！");
                return;
            }
            document.getElementById("help").className = "help_used";
            human = reverse(human);
            nolos = reverse(nolos);
            over = true;
            document.getElementById("help").disabled = over;
            document.getElementById("timer").innerHTML = "电脑正在思考……";
            d1 = (new Date()).getTime();
            setTimeout(function () {
                ai();
                step++;
                if (iswin[nolos] == true) {
                    document.getElementById("timer").innerHTML = nolos == white ? "白棋胜！请重新启动程序。" : "黑棋胜！请重新启动程序。";
                    return;
                }
                if (step >= 225) {
                    document.getElementById("timer").innerHTML = "平局！请重新启动程序。";
                    return;
                }
                over = false;
                document.getElementById("help").disabled = over;
                d2 = (new Date()).getTime();
                document.getElementById("timer").innerHTML = "本次电脑思考用时" + (d2 - d1 - 100).toString() + "毫秒。";
            }, 100);
        }

        function ai() {
            var bests = [];
            for (var i = 0; i < preRecord.length; i++) {
                if (match(currentRecord, preRecord[i])) {
                    bests[0] = preRecord[i][currentRecord.length];
                    bests[0].push(nolos == black ? INFINITY : -INFINITY);
                    break;
                }
            }
            if (bests.length == 0) {
                for (var i = 0; i < 15; i++) {
                    for (var j = 0; j < 15; j++) {
                        if (getv(i, j) == empty) {
                            bests.push([i, j, eval(i, j, nolos) * 1 + eval(i, j, human)]);
                        }
                    }
                }
                bests.sort((a, b) => b[2] - a[2]);
                bests.splice(7);
                for (var i = 0; i < bests.length; i++) {
                    var _bwin = [], _wwin = [];
                    for (var j = 0; j < wincount; j++) {
                        _bwin[j] = bwin[j];
                        _wwin[j] = wwin[j];
                    }
                    setv(bests[i][0], bests[i][1], nolos, true);
                    if (iswin[nolos]) {
                        bests[i][2] = INFINITY;
                        qp[bests[i][0]][bests[i][1]] = empty;
                        for (var j = 0; j < wincount; j++) {
                            bwin[j] = _bwin[j];
                            wwin[j] = _wwin[j];
                        }
                        iswin = { black: false, white: false };
                        break;
                    }
                    bests[i][2] = -search(human, Math.min(5, step + 1), -INFINITY, INFINITY);
                    qp[bests[i][0]][bests[i][1]] = empty;
                    for (var j = 0; j < wincount; j++) {
                        bwin[j] = _bwin[j];
                        wwin[j] = _wwin[j];
                    }
                    console.log("落在" + bests[i][0] + "，" + bests[i][1] + "处的评分是" + bests[i][2] + "分。");
                    if (bests[i][2] >= INFINITY) break;
                }
                bests.sort((a, b) => b[2] - a[2]);
            }
            setv(bests[0][0], bests[0][1], nolos);
            console.log("电脑选择落在" + bests[0][0] + "，" + bests[0][1] + "处，" + (bests[0][2] >= INFINITY ? "计算机必胜！" : bests[0][2] <= -INFINITY ? "玩家必胜！" : "未见分晓！"));
        }
        //打分函数
        function eval(x, y, player) {
            var score = 0;
            for (var k = 0; k < wincount; k++) {
                if (wins[x][y][k]) {
                    switch (player == black ? bwin[k] : wwin[k]) {
                        case 1:
                            score += 1;
                            break;
                        case 2:
                            score += 40;
                            break;
                        case 3:
                            score += 120;
                            break;
                        case 4:
                            score += 20000;
                            break;
                    }
                }
            }
            return score;
        }

        function evalglob(player) {
            var score = 0;
            for (var k = 0; k < wincount; k++) {
                switch (player == black ? bwin[k] : wwin[k]) {
                    case 1:
                        score += 1;
                        break;
                    case 2:
                        score += 40;
                        break;
                    case 3:
                        score += 120;
                        break;
                    case 4:
                        score += 20000;
                        break;
                }
            }
            return score;
        }

        function search(player, depth, alpha, beta) {
            if (depth == 0) return evalglob(player) - evalglob(reverse(player));
            var bests = [], self_score = 0, enemy_score = 0;
            for (var i = 0; i < 15; i++) {
                for (var j = 0; j < 15; j++) {
                    if (getv(i, j) == empty) {
                        self_score = eval(i, j, player);
                        enemy_score = eval(i, j, reverse(player));
                        bests.push([i, j, self_score + enemy_score, canVCT(self_score) || canVCT(enemy_score)]);
                    }
                }
            }
            if (bests.length == 0) return evalglob(player) - evalglob(reverse(player));
            bests.sort((a, b) => b[2] - a[2]);
            if (depth == 4 || depth == 5 && step >= 6 && bests[0][3]) {
                var ret_val = VCT(player, 5 + depth, false);
                if (ret_val >= INFINITY || ret_val <= -INFINITY) {
                    return ret_val;
                }
            }
            bests.splice(7);
            var value;
            var _bwin = [], _wwin = [];
            for (var i = 0; i < bests.length; i++) {
                for (var j = 0; j < wincount; j++) {
                    _bwin[j] = bwin[j];
                    _wwin[j] = wwin[j];
                }
                setv(bests[i][0], bests[i][1], player, true);
                if (iswin[player]) {
                    qp[bests[i][0]][bests[i][1]] = empty;
                    for (var j = 0; j < wincount; j++) {
                        bwin[j] = _bwin[j];
                        wwin[j] = _wwin[j];
                    }
                    iswin = { black: false, white: false };
                    return INFINITY;
                }
                value = -search(reverse(player), depth - 1, -beta, -alpha);
                qp[bests[i][0]][bests[i][1]] = empty;
                for (var j = 0; j < wincount; j++) {
                    bwin[j] = _bwin[j];
                    wwin[j] = _wwin[j];
                }
                if (value > alpha) alpha = value;
                if (alpha >= beta) break;
            }
            return alpha;
        }

        function VCT(player, maxdepth, parentCanVCT) {
            if (maxdepth == 0) return 0;
            var bests = [], self_score = 0, enemy_score = 0, v = -INFINITY;
            for (var i = 0; i < 15; i++) {
                for (var j = 0; j < 15; j++) {
                    if (getv(i, j) == empty) {
                        self_score = eval(i, j, player);
                        enemy_score = eval(i, j, reverse(player));
                        bests.push([i, j, self_score + enemy_score, canVCT(self_score) || canVCT(enemy_score)]);
                    }
                }
            }
            bests.sort((a, b) => b[2] - a[2]);
            if (!bests[0][3] && !parentCanVCT) return 0;
            bests.splice(3);
            var _bwin = [], _wwin = [];
            for (var i = 0; i < bests.length; i++) {
                for (var j = 0; j < wincount; j++) {
                    _bwin[j] = bwin[j];
                    _wwin[j] = wwin[j];
                }
                setv(bests[i][0], bests[i][1], player, true);
                if (iswin[player]) {
                    qp[bests[i][0]][bests[i][1]] = empty;
                    for (var j = 0; j < wincount; j++) {
                        bwin[j] = _bwin[j];
                        wwin[j] = _wwin[j];
                    }
                    iswin = { black: false, white: false };
                    return INFINITY;
                }
                v = Math.max(v, -VCT(reverse(player), maxdepth - 1, bests[i][3]));
                qp[bests[i][0]][bests[i][1]] = empty;
                for (var j = 0; j < wincount; j++) {
                    bwin[j] = _bwin[j];
                    wwin[j] = _wwin[j];
                }
                if (v >= INFINITY) break;
            }
            return v;
        }
    </script>
</head>

<body></body>

</html>